package com.minimalist.common.entity.lindi.vo.subsidyapplicationfile;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.entity.basic.vo.file.FileVO;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author 11987
 */

@Schema(name = "林地指标交易平台_补贴申请文件实体")
public class LindiSubsidyApplicationFileVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "id", description = "主键ID", type = "string")
    private Long id;

    @NotNull(message = "补贴申请ID不能为空", groups = {Add.class, Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "subsidyApplicationId", description = "补贴申请ID", type = "string")
    private Long subsidyApplicationId;

    @NotNull(message = "文件ID不能为空", groups = {Add.class, Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "fileId", description = "文件ID", type = "string")
    private Long fileId;

    @NotBlank(message = "文件类型不能为空", groups = {Add.class, Update.class})
    @Schema(name = "fileType", description = "文件类型", type = "string")
    private String fileType;

    private FileVO file;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "创建人ID", type = "string")
    private Long createId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "createTime", description = "创建时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    public LindiSubsidyApplicationFileVO(){
    }

    public Long getId(){
        return id;
    }

    public void setId(Long id){
        this.id = id;
    }

    public Long getSubsidyApplicationId(){
        return subsidyApplicationId;
    }

    public void setSubsidyApplicationId(Long subsidyApplicationId){
        this.subsidyApplicationId = subsidyApplicationId;
    }

    public Long getFileId(){
        return fileId;
    }

    public void setFileId(Long fileId){
        this.fileId = fileId;
    }

    public String getFileType(){
        return fileType;
    }

    public void setFileType(String fileType){
        this.fileType = fileType;
    }

    public FileVO getFile(){
        return file;
    }

    public void setFile(FileVO file){
        this.file = file;
    }

    public Long getCreateId(){
        return createId;
    }

    public void setCreateId(Long createId){
        this.createId = createId;
    }

    public Long getUpdateId(){
        return updateId;
    }

    public void setUpdateId(Long updateId){
        this.updateId = updateId;
    }

    public LocalDateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime){
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime(){
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime){
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        LindiSubsidyApplicationFileVO that = (LindiSubsidyApplicationFileVO) o;
        return Objects.equals(id, that.id) && Objects.equals(subsidyApplicationId, that.subsidyApplicationId) && Objects.equals(fileId, that.fileId) && Objects.equals(fileType, that.fileType) && Objects.equals(file, that.file) && Objects.equals(createId, that.createId) && Objects.equals(updateId, that.updateId) && Objects.equals(createTime, that.createTime) && Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode(){
        return Objects.hash(id, subsidyApplicationId, fileId, fileType, file, createId, updateId, createTime, updateTime);
    }
}
